home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / patches / pgs3h21.lha / 3.0h2Update / PrinterPS.LHA / PostScript.prolog < prev   
Text File  |  1995-10-11  |  24KB  |  936 lines

  1. %%BeginProlog
  2. % $VER: PostScript.prolog 1.0h (09.07.95)
  3. % fixed picstr problem in BeginRGBBitmap (7.10.94)
  4. % added font reencoding support (29.10.94)
  5. % complete change to fill/stroke for support for text (02.02.95)
  6. % fixed landscape to non-letter sizes
  7. % fixed grave/quotesingle encoding (15.02.95)
  8. % changed for new tm2d based code w/ new object calls (15.03.95)
  9. % fixed process color seps (24.03.95)
  10. % added PPDSetup/PPDCleanup (20.06.95)
  11. % now reencodes Courier for document name in slug (eeckk!) (09.07.95)
  12. % reencode dict increased by 2 (02.08.95)
  13. % recursive object tm (15.08.95)
  14. % prolog dict increased to 200 (01.09.95)
  15. % prolog rewrite of fill/stroke routines for text & added newpath to dograd/doradial/doshape (01.09.95)
  16. % new BeginClip/EndClip & BeginEPS/EndEPS (10.10.95)
  17. %Copyright 1994-95 Soft-Logik Publishing Corp.
  18.  
  19. /AsphaltDict dup 200 dict def load begin
  20.  
  21. %
  22. % basic definitions
  23. %
  24. /bdef {bind def}bind def
  25. /xdef {exch def}bdef
  26. /ldef {load def}bdef
  27. /dmatrix matrix def
  28. /tmatrix matrix def
  29. /pmatrix matrix def
  30.  
  31. /deltax 0 def
  32. /deltay 0 def
  33. /slant 0 def
  34. /twist 0 def
  35. /xscl 0 def
  36. /yscl 0 def
  37. /bang 0 def
  38. /eang 0 def
  39.  
  40. /tilescalex 0 def
  41. /tilescaley 0 def
  42. /bh 0 def
  43. /bv 0 def
  44.  
  45. %
  46. % fill defines
  47. %
  48. /SG /setgray ldef
  49. systemdict /setcmykcolor known not
  50.  {/SCMYK {1 sub 4 1 roll 3 {3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdef}
  51.  {/SCMYK /setcmykcolor ldef}ifelse
  52.  
  53. %
  54. % drawing definitions
  55. %
  56. /sclm [0 0 0 0 0 0] def
  57. /scl{transform round .2 add exch round .2 add exch itransform}bdef
  58.  
  59. %
  60. %
  61. %
  62. /PGSEncoding 256 array def
  63. % duplicates: acute, quoteleft, quoteright
  64. % 000-007
  65. /.notdef        /dotlessi        /grave            /acute            /circumflex        /tilde            /breve            /dotaccent
  66. % 010-017
  67. /ring            /hungarumlaut    /ogonek            /caron            /.notdef        /.notdef        /.notdef        /.notdef
  68. % 020-027
  69. /quotedblbase    /quotesinglbase    /quotesingle    /quoteleft        /quoteright        /.notdef        /.notdef        /.notdef
  70. % 030-037
  71. /.notdef        /.notdef        /.notdef        /.notdef        /.notdef        /.notdef        /.notdef        /.notdef
  72. % 040-047
  73. /space            /exclam            /quotedbl        /numbersign        /dollar            /percent        /ampersand        /quotesingle
  74. % 050-057
  75. /parenleft        /parenright        /asterisk        /plus            /comma            /hyphen            /period            /slash
  76. % 060-067
  77. /zero            /one            /two            /three            /four            /five            /six            /seven
  78. % 070-077
  79. /eight            /nine            /colon            /semicolon        /less            /equal            /greater        /question
  80. % 100-107
  81. /at                /A                /B                /C                /D                /E                /F                /G
  82. % 110-117
  83. /H                /I                /J                /K                /L                /M                /N                /O
  84. % 120-127
  85. /P                /Q                /R                /S                /T                /U                /V                /W
  86. % 130-137
  87. /X                /Y                /Z                /bracketleft    /backslash        /bracketright    /asciicircum    /underscore
  88. % 140-147
  89. /grave            /a                /b                /c                /d                /e                /f                /g
  90. % 150-157
  91. /h                /i                /j                /k                /l                /m                /n                /o
  92. % 160-167
  93. /p                /q                /r                /s                /t                /u                /v                /w
  94. % 170-177
  95. /x                /y                /z                /braceleft        /bar            /braceright        /asciitilde        /.notdef
  96. % 200-207
  97. /perthousand    /florin            /notequal        /infinity        /lessequal        /greaterequal    /.notdef        /.notdef
  98. % 210-217
  99. /ellipsis        /endash            /emdash            /quotedblleft    /quotedblright    /guilsinglleft    /guilsinglright    /pi                
  100. % 220-227
  101. /fraction        /dagger            /daggerdbl        /trademark        /bullet            /fi                /fl                /Ydieresis        
  102. % 230-237
  103. /Lslash            /lslash            /OE                /oe                /Scaron            /scaron            /Zcaron            /zcaron            
  104. % 240-247
  105. /space            /exclamdown        /cent            /sterling        /currency        /yen            /brokenbar        /section
  106. % 250-257
  107. /dieresis        /copyright        /ordfeminine    /guillemotleft    /logicalnot        /minus            /registered        /macron
  108. % 260-267
  109. /degree            /plusminus        /twosuperior    /threesuperior    /acute            /mu                /paragraph        /periodcentered
  110. % 270-277
  111. /cedilla        /onesuperior    /ordmasculine    /guillemotright    /onequarter        /onehalf        /threequarters    /questiondown
  112. % 300-307
  113. /Agrave            /Aacute            /Acircumflex    /Atilde            /Adieresis        /Aring            /AE                /Ccedilla
  114. % 310-317
  115. /Egrave            /Eacute            /Ecircumflex    /Edieresis        /Igrave            /Iacute            /Icircumflex    /Idieresis
  116. % 320-327
  117. /Eth            /Ntilde            /Ograve            /Oacute            /Ocircumflex    /Otilde            /Odieresis        /multiply
  118. % 330-337
  119. /Oslash            /Ugrave            /Uacute            /Ucircumflex    /Udieresis        /Yacute            /Thorn            /germandbls
  120. % 340-347
  121. /agrave            /aacute            /acircumflex    /atilde            /adieresis        /aring            /ae                /ccedilla
  122. % 350-357
  123. /egrave            /eacute            /ecircumflex    /edieresis        /igrave            /iacute            /icircumflex    /idieresis
  124. % 360-367
  125. /eth            /ntilde            /ograve            /oacute            /ocircumflex    /otilde            /odieresis        /divide
  126. % 370-377
  127. /oslash            /ugrave            /uacute            /ucircumflex    /udieresis        /yacute            /thorn            /ydieresis
  128. PGSEncoding 0 256 getinterval astore pop
  129.  
  130. %
  131. % path constructors
  132. %
  133. % - N -
  134. /N/newpath ldef
  135.  
  136. % x y M -
  137. /M{scl moveto}bdef
  138.  
  139. % x y L -
  140. /L{scl lineto}bdef
  141.  
  142. % cx1 cy1 cx2 cy2 px2 py2 C -
  143. /C{scl 6 2 roll scl 6 2 roll scl 6 2 roll curveto}bdef
  144.  
  145. % cx cy rx ry ba ea slant twist A -
  146. /A{matrix currentmatrix 9 1 roll /twist xdef/slant xdef/eang xdef/bang xdef/yscl xdef/xscl xdef scl translate xscl yscl scale sclm 0 twist cos put
  147. sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat 0 0 1 bang eang arc setmatrix}bdef
  148.  
  149. % cx cy rx ry ba ea slant twist AN -
  150. /AN{matrix currentmatrix 9 1 roll /twist xdef/slant xdef/eang xdef/bang xdef/yscl xdef/xscl xdef scl translate xscl yscl scale sclm 0 twist cos put
  151. sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat 0 0 1 bang eang arcn setmatrix}bdef
  152.  
  153. % - CP -
  154. /CP/closepath ldef
  155.  
  156. %
  157. % pattern fill operators
  158. %
  159. % - patternpath -
  160. /patternpath{ %bdef
  161.   /mypatternfont findfont begin FontDict /ctm get setmatrix
  162.   currentdict setfont
  163.  
  164.   FontDict begin
  165.     FontMatrix concat
  166.     width 0 dtransform
  167.     round width div exch round width div exch
  168.     0 height dtransform
  169.     round height div exch
  170.     round height div exch
  171.     0 0 transform round exch round exch
  172.     ptm astore setmatrix
  173.     pathbbox
  174.     height div ceiling height mul 4 1 roll
  175.     width div ceiling width mul 4 1 roll
  176.     height div floor height mul 4 1 roll
  177.     width div floor width mul 4 1 roll
  178.     2 index sub height div ceiling cvi exch
  179.     3 index sub width div ceiling cvi exch
  180.     4 2 roll moveto
  181.     FontMatrix ptm invertmatrix pop
  182.     { %repeat
  183.       gsave
  184.       ptm concat
  185.       dup str length idiv {str show}repeat
  186.       dup str length mod str exch 0 exch getinterval show
  187.       grestore
  188.       0 height rmoveto
  189.     }repeat
  190.     pop
  191.   end end
  192. }bdef
  193.  
  194. % - patternfill -
  195. /patternfill{ %bdef
  196.   gsave
  197.   1 setgray
  198.   fill
  199.   grestore
  200.  
  201.   gsave
  202.   clip patternpath
  203.   grestore
  204.   newpath
  205. }bdef
  206.  
  207. % - patterneofill -
  208. /patterneofill{ %bdef
  209.   gsave
  210.   1 setgray
  211.   eofill
  212.   grestore
  213.  
  214.   gsave
  215.   eoclip patternpath
  216.   grestore
  217.   newpath
  218. }bdef
  219.  
  220. % - patternstroke -
  221. /patternstroke{ %bdef
  222.   strokepath
  223.   gsave
  224.   1 setgray
  225.   eofill
  226.   grestore
  227.  
  228.   gsave
  229.   clip patternpath
  230.   grestore
  231.   newpath
  232. }bdef
  233.  
  234. % <pattern> P -
  235. /P{
  236.  /pattern xdef
  237.  /mypatternfont findfont begin
  238.  FontDict begin
  239.  true
  240.   0 1 patterncount 1 sub {
  241.    dup patterns exch get pattern eq
  242.       {0 1 str length 1 sub{str exch 2 index put}for pop pop false exit}
  243.    if
  244.    pop
  245.  }for
  246.  {
  247.    patterns patterncount pattern put
  248.     0 1 str length 1 sub {str exch patterncount put}for
  249.    /patterncount patterncount 1 add def
  250.  }if
  251.  end
  252.  end
  253.  /FILL{patternfill}bdef
  254.  /EOFILL{patterneofill}bdef
  255.  /STROKE{patternstroke}bdef
  256. }bdef
  257.  
  258. /S{
  259.  /FILL{fill}bdef
  260.  /EOFILL{eofill}bdef
  261.  /STROKE{stroke}bdef
  262. }bdef
  263.  
  264. %
  265. % gradient/radial/shape fill operators
  266. %
  267. /DOGRAD{
  268.  gsave
  269.  pmatrix setmatrix flattenpath exec 
  270.  pathbbox /ury xdef /urx xdef /lly xdef /llx xdef
  271.  angle 0 lt{/angle angle 360 add def}if
  272.  angle 180 gt{/angle angle 180 sub def tc1 tc2 /tc1 xdef /tc2 xdef}if
  273.  angle 90 gt{ /quad {ury exch sub}bdef tc1 tc2 /tc1 xdef /tc2 xdef}{ /quad {lly add}bdef}ifelse
  274.  /l urx llx sub def
  275.  /w ury lly sub def
  276.  /v angle dup 90 gt{90 sub neg 90 add}if dup sin l mul exch cos w mul add 2 mul def
  277.  /d angle dup 90 gt{90 sub neg 90 add}if dup sin w mul exch cos l mul add def
  278.  /steps d 72 div currentscreen pop pop mul cvi 1 add dup 256 gt{pop 256}if def
  279.  /dd d steps div def
  280.  
  281.  0 1 steps
  282.  {
  283.   steps div dup /frac xdef ramp /rfrac xdef
  284.   tc2 0 get tc1 0 get sub rfrac mul tc1 0 get add
  285.   tc2 1 get tc1 1 get sub rfrac mul tc1 1 get add
  286.   tc2 2 get tc1 2 get sub rfrac mul tc1 2 get add
  287.   tc2 3 get tc1 3 get sub rfrac mul tc1 3 get add scmyk
  288.  
  289.   newpath gsave
  290.   l frac mul llx add
  291.   w frac mul quad translate angle rotate 
  292.   dd 2 div neg v 2 div neg moveto
  293.   0 v rlineto dd 0 rlineto 0 v neg rlineto closepath
  294.   FILL grestore
  295.  }for
  296.  
  297.  grestore
  298.  newpath
  299. }bdef
  300.  
  301. %
  302. %
  303. /DORADIAL{
  304.  gsave
  305.  pmatrix setmatrix flattenpath exec 
  306.  pathbbox /ury xdef /urx xdef /lly xdef /llx xdef
  307.  /xc llx urx add 2 div dx add def
  308.  /yc lly ury add 2 div dy add def
  309.  /radius llx xc sub abs dup mul sqrt lly yc sub abs dup mul sqrt add def
  310.  
  311.  /steps radius 72 div currentscreen pop pop mul cvi 1 add dup 256 gt{pop 256}if def
  312.  
  313.  steps -1 0
  314.  {
  315.   steps div dup /frac xdef ramp /rfrac xdef
  316.   tc2 0 get tc1 0 get sub rfrac mul tc1 0 get add
  317.   tc2 1 get tc1 1 get sub rfrac mul tc1 1 get add
  318.   tc2 2 get tc1 2 get sub rfrac mul tc1 2 get add
  319.   tc2 3 get tc1 3 get sub rfrac mul tc1 3 get add scmyk
  320.   newpath xc yc radius frac mul 0 360 arc FILL
  321.  }for
  322.  
  323.  grestore
  324.  newpath
  325. }bdef
  326.  
  327. %
  328. %
  329. /DOSHAPE{
  330.  /steps 30 def
  331.  /fillproc xdef
  332.  
  333.  currentflat mark currentflat
  334.  {
  335.   {
  336.    dup setflat mark fillproc
  337.  
  338.    tc1 0 get tc1 1 get tc1 2 get tc1 3 get scmyk
  339.    currentflat mark currentflat
  340.    {
  341.     dup setflat mark
  342.     {FILL}gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {cleartomark setflat stop}if}{cleartomark exit}ifelse
  343.    }loop
  344.    cleartomark setflat
  345.  
  346.    steps -1 0
  347.    {
  348.     steps div dup /frac xdef ramp /rfrac xdef
  349.     tc1 0 get tc2 0 get sub rfrac mul tc2 0 get add
  350.     tc1 1 get tc2 1 get sub rfrac mul tc2 1 get add
  351.     tc1 2 get tc2 2 get sub rfrac mul tc2 2 get add
  352.     tc1 3 get tc2 3 get sub rfrac mul tc2 3 get add scmyk
  353.     []0 setdash xc 2 mul frac mul setlinewidth
  354.  
  355.     currentflat mark currentflat
  356.     {
  357.      dup setflat mark
  358.      {STROKE}gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {cleartomark setflat stop}if}{cleartomark exit}ifelse
  359.     }loop
  360.     cleartomark setflat
  361.  
  362.    }for
  363.   }
  364. %  gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {cleartomark setflat stop}if}{cleartomark exit}ifelse
  365.   gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {exit}if}{cleartomark exit}ifelse
  366.  }loop
  367.  cleartomark setflat
  368.  newpath
  369. }bdef
  370.  
  371. %
  372. % join miterlimit cap [dashpattern] dashoffset width ST -
  373. %
  374. /ST {
  375.  setlinewidth setdash setlinecap
  376.  2 div sin 1 exch div setmiterlimit
  377.  setlinejoin strokepath
  378. }bdef
  379.  
  380. % fill functions
  381. %
  382. % endfunc scale angle x y LNE -
  383. %
  384. /LNE {
  385.  matrix currentmatrix 6 1 roll scl translate rotate dup scale
  386.  load exec setmatrix
  387. }bdef
  388.  
  389. %
  390. % screen spot functions
  391. %
  392. /SSNewDot {180 mul cos exch 180 mul cos add 2 div}bdef
  393. /SSDot {dup mul exch dup mul add 1.0 exch sub}bdef
  394. /SSRing {dup mul exch dup mul add 1.0 exch sub abs 1.0 exch sub}bdef
  395. /SSDonut {dup mul exch dup mul add sqrt .5 sub abs 1.0 exch sub}bdef
  396. /SSLine {exch pop abs}bdef
  397. /SSTriangle {2 exch sub exch abs 2 mul sub 3 div}bdef
  398. /SSPropeller {/y xdef /x xdef y x .001 add atan cvi 72 mod 72 sub abs 72 div y y mul x x mul add 1 exch sub add 2 div}bdef
  399.  
  400. %
  401. % fountain blend functions
  402. %
  403. /FBLinear {}bdef
  404. /FBInvLinear {1 exch sub}bdef
  405. /FBLog {9 mul 1 add log}bdef
  406. /FBInvLog {9 mul 1 add log 1 exch sub}bdef
  407. /FBSin {180 mul sin}bdef
  408. /FBInvSin {180 mul sin 1 exch sub}bdef
  409. /FBSaw {2 mul dup 1 gt {2 exch sub}if}bdef
  410. /FBInvSaw {2 mul dup 1 gt {2 exch sub}if 1 exch sub}bdef
  411.  
  412. %
  413. % line end functions
  414. %
  415. /LERound {0 0 moveto 0 0 .5 -90 90 arc closepath}bdef
  416. /LEArrow {0 0 moveto 0 2 lineto 6 0 lineto 0 -2 lineto closepath}bdef
  417. /LEArrow1 {0 0 moveto 0 2 lineto 6 0 lineto 0 -2 lineto closepath}bdef
  418. /LEArrow2 {0 0 moveto -2 2 lineto 6 0 lineto -2 -2 lineto closepath}bdef
  419. /LEArrow3 {6 0 moveto -3 0 2.31 300 60 arc closepath}bdef
  420. /LEArrow4 {-1 0 moveto -4 2 .5 240 60 arcn 0 0 .5 60 300 arcn -4 -2 .5 300 120 arcn closepath}bdef
  421. /LESpike1 {0 .5 moveto .5 2 lineto 1 .5 lineto 6 0 lineto 1 -.5 lineto .5 -2 lineto 0 -.5 lineto closepath}bdef
  422. /LESpike2 {0 .5 moveto 2 2 lineto 6 0 lineto 2 -2 lineto 0 -.5 lineto closepath}bdef
  423. /LEFeather1 {-2 0 moveto 0 2 lineto 6 2 lineto 4 0 lineto 6 -2 lineto 0 -2 lineto closepath}bdef
  424. /LEFeather2 {0 -2 moveto 0 0 2 270 90 arcn 6 0 2 90 270 arc closepath}bdef
  425. /LEBox {-2 0 moveto -2 2 lineto 2 2 lineto 2 -2 lineto -2 -2 lineto closepath}bdef
  426. /LEDiamond {-2 0 moveto 0 2 lineto 2 0 lineto 0 -2 lineto closepath}bdef
  427. /LEBall {0 0 moveto 0 0 2 360 0 arcn closepath}bdef
  428. /LEEllipse {2 1 scale 0 0 moveto 0 0 2 360 0 arcn closepath}bdef
  429.  
  430. %
  431. % freq angle spot SS -
  432. %
  433. /SS {
  434.  load setscreen
  435. }bdef
  436.  
  437. %
  438. % text prototypes
  439. %
  440. % (string) F1 -
  441. % (string) kernamt F2 -
  442. % (string) skernamt F3 -
  443. % (string) skernamt kernamt F4 -
  444. %
  445.  
  446. /FS{dup length 1 sub 0 exch 1 exch}bdef
  447. /Fx{1 index exch 1 getinterval dup currentpoint currentpoint newpath moveto 3 -1 roll false charpath FP moveto}bdef
  448. /Sx{1 index exch 1 getinterval dup currentpoint currentpoint newpath moveto 3 -1 roll false charpath SP moveto}bdef
  449.  
  450. /S1{FS {Sx stringwidth rmoveto}for pop}bdef
  451. /S2{/dx xdef FS {Sx stringwidth rmoveto dx 0 rmoveto}for pop}bdef
  452. /S3{/dy xdef FS {Sx dup stringwidth rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  453. /S4{/dy xdef /dx xdef FS {Sx dup stringwidth rmoveto dx 0 rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  454.  
  455. /CFx{
  456.  /F1{FS {Fx stringwidth rmoveto}for pop}bdef
  457.  /F2{/dx xdef FS {Fx stringwidth rmoveto dx 0 rmoveto}for pop}bdef
  458.  /F3{/dy xdef FS {Fx dup stringwidth rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  459.  /F4{/dy xdef /dx xdef FS {Fx dup stringwidth rmoveto dx 0 rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  460. }bdef
  461.  
  462. %
  463. % c m y k CMYK -
  464. %
  465. /CMYK {
  466.  scmyk
  467.  
  468.  /FP{FILL}bdef
  469.  /EP{EOFILL}bdef
  470.  /SP{STROKE}bdef
  471.  
  472.  /F1{show}bdef
  473.  /F2{exch 0 exch ashow}bdef
  474.  /F3{exch 0 exch 32 exch widthshow}bdef
  475.  /F4{0 exch 32 exch 0 6 -1 roll awidthshow}bdef
  476. }bdef
  477.  
  478. %
  479. % angle /ramp [c1 m1 y1 k1][c2 m2 y2 k2] CMYKGRAD -
  480. %
  481. /CMYKGRAD{
  482.  /tc2 xdef
  483.  /tc1 xdef
  484.  /ramp exch ldef
  485.  /angle xdef
  486.  
  487.  /FP{{clip} DOGRAD}bdef
  488.  /EP{{eoclip} DOGRAD}bdef
  489.  /SP{strokepath {clip} DOGRAD}bdef
  490.  
  491.  CFx
  492. }bdef
  493.  
  494. %
  495. % dx dy /ramp [c1 m1 y1 k1][c2 m2 y2 k2] CMYKRADIAL -
  496. %
  497. /CMYKRADIAL{
  498.  /tc2 xdef
  499.  /tc1 xdef
  500.  /ramp exch ldef
  501.  /dy xdef
  502.  /dx xdef
  503.  
  504.  /FP{{clip} DORADIAL}bdef
  505.  /EP{{eoclip} DORADIAL}bdef
  506.  /SP{strokepath {clip} DORADIAL}bdef
  507.  
  508.  CFx
  509. }bdef
  510.  
  511. %
  512. % inset /ramp [c1 m1 y1 k1][c2 m2 y2 k2] CMYKSHAPE -
  513. %
  514. /CMYKSHAPE{
  515.  /tc2 xdef
  516.  /tc1 xdef
  517.  /ramp exch ldef
  518.  /xc xdef
  519.  
  520.  /FP{{clip} DOSHAPE}bdef
  521.  /EP{{eoclip} DOSHAPE}bdef
  522.  /SP{strokepath {clip} DOSHAPE}bdef
  523.  
  524.  CFx
  525. }bdef
  526.  
  527.  
  528. /installcolor {
  529.  dup type /stringtype eq {pop dangle}if exch dup type /stringtype eq {pop dfreq}if exch /dspot load setscreen
  530.  
  531.  /sepmode xdef
  532.  
  533.  sepmode 1 eq {
  534.   /scmyk{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdef
  535.   /setgray /SG load def
  536.  }if
  537.  
  538.  sepmode 2 eq {
  539.   /scmyk /SCMYK load def
  540.   /setgray /SG load def
  541.  }if
  542.  
  543.  sepmode 3 eq {
  544.   /sepcolor xdef
  545.   sepcolor 0 get 0 ne {/scmyk {pop pop pop 1 exch sub SG}bdef /setgray {pop 1 SG}bdef}if
  546.   sepcolor 1 get 0 ne {/scmyk {pop pop 1 exch sub SG pop}bdef /setgray {pop 1 SG}bdef}if
  547.   sepcolor 2 get 0 ne {/scmyk {pop 1 exch sub SG pop pop}bdef /setgray {pop 1 SG}bdef}if
  548.   sepcolor 3 get 0 ne {/scmyk {1 exch sub SG pop pop pop}bdef /setgray /SG load def}if
  549.  }if
  550.  
  551.  sepmode 4 eq {
  552.   /sepcolor xdef
  553.   /scmyk {
  554.    sepcolor 3 get eq exch
  555.    sepcolor 2 get eq and exch
  556.    sepcolor 1 get eq and exch
  557.    sepcolor 0 get eq and {0 SG}{1 SG}ifelse}bdef
  558.   sepcolor 3 get 1 eq sepcolor 2 get 0 eq and sepcolor 1 get 0 eq and sepcolor 0 get 0 eq and {/setgray /SG load def}{/setgray {pop 1 SG}bdef}ifelse
  559.  }if
  560.  /setcmykcolor /scmyk load def
  561.  
  562.  currentscreen /cspot xdef /cangle xdef /cfreq xdef
  563. }bdef
  564.  
  565. %
  566. % #copies BEGINDOCUMENT -
  567. %
  568. /BeginDocument{
  569.  /#copies xdef
  570.  
  571.   7 dict begin
  572.     /FontDict 12 dict def
  573.     FontDict begin
  574.       /key /mypatternfont def
  575.       /patterns 256 array def
  576.       /patterncount 0 def
  577.       /char 0 def
  578.       /mtx [300 72 div 0 0 300 72 div 0 0] matrix invertmatrix def
  579.       /height 30 def
  580.       /width 30 def
  581.       /ctm matrix currentmatrix def
  582.       /ptm matrix identmatrix def
  583.       /str 32 string def
  584.     end
  585.     /FontBBox [0 0 FontDict /width get FontDict /height get] def
  586.     /FontMatrix FontDict /mtx get def
  587.     /Encoding 256 array 0 1 255 {1 index exch dup 3 string cvs cvn put}for def
  588.     /FontType 3 def
  589.     /BuildChar { %def
  590.       exch begin
  591.       FontDict begin
  592.       /char xdef
  593.        width 0 0 0 width height setcachedevice
  594.       width height scale 8 8 true [8 0 0 -8 0 8] {patterns char get}imagemask
  595.       end end
  596.     }def
  597.     FontDict /key get currentdict definefont pop
  598.   end
  599.  
  600.  /dmatrix dmatrix currentmatrix def
  601.  currentscreen /dspot xdef /dangle xdef /dfreq xdef
  602. }bdef
  603.  
  604. %
  605. % /newfontname /fontname RE -
  606. %
  607. /RE{
  608.  mark {FontDirectory 3 index get} stopped
  609.  {cleartomark
  610.   findfont dup length 2 add dict begin {1 index /FID ne {def}{pop pop}ifelse}forall
  611.   /Encoding PGSEncoding def
  612.   /FontName 1 index def
  613.   currentdict definefont pop
  614.   end
  615.  }
  616.  {cleartomark pop pop}ifelse
  617. }bdef
  618.  
  619. %
  620. % /fontname xscale yscale slant twist F -
  621. %
  622. /F{
  623.  /twist xdef /slant xdef /yscale xdef /xscale xdef
  624.  findfont [xscale 0 0 yscale 0 0] [twist cos twist sin slant sin neg slant cos 0 0] sclm concatmatrix makefont setfont
  625. }bdef
  626.  
  627. %
  628. % - ENDOCUMENT -
  629. %
  630. /EndDocument{
  631. }bdef
  632.  
  633. %
  634. % [sepcolor] sepmode freq/(DEFAULT) angle/(DEFAULT) tilew tileh landscape scaleh scalex paperw paperh BEGINTILE -
  635. %
  636. /BeginTile{
  637.  2 div exch 2 div exch translate
  638.  /tilescaley xdef /tilescalex xdef tilescalex tilescaley scale
  639.  {90 rotate} if
  640.  -2 div exch -2 div exch translate
  641.  
  642.  installcolor
  643.  
  644.  /tmatrix tmatrix currentmatrix def
  645. }bdef
  646.  
  647. %
  648. % - ENDTILE -
  649. %
  650. /EndTile{
  651.  dmatrix setmatrix
  652. }bdef
  653.  
  654. %
  655. % [sepcolor] sepmode freq/(DEFAULT) angle/(DEFAULT) title left top right bottom THUMBNAILMARKS -
  656. %
  657. /ThumbnailMarks{
  658.  /tiley2 xdef
  659.  /tilex2 xdef
  660.  /tiley1 xdef
  661.  /tilex1 xdef
  662.  /title1 xdef
  663.  
  664.  tmatrix setmatrix
  665.  .5 SG 6 setlinewidth
  666.  newpath
  667.  tilex1 3 add tiley2 3 sub moveto
  668.  tilex2 3 add tiley2 3 sub lineto
  669.  tilex2 3 add tiley1 3 sub lineto stroke
  670.  
  671.  0 SG [] 0 setdash .3 setlinewidth 0 setlinejoin 0 setlinecap
  672.  newpath tilex1 tiley1 moveto tilex2 tiley1 lineto tilex2 tiley2 lineto tilex1 tiley2 lineto closepath stroke
  673.  
  674.  gsave tilex1 tilex2 add 2 div tiley2 translate 1 tilescalex div 1 tilescaley div scale -2 -6 bv sub translate
  675.  /PGSCourier/Courier RE /PGSCourier findfont 6 scalefont setfont
  676.  0 0 moveto title1 show
  677.  grestore
  678.  
  679.  installcolor
  680. }bdef
  681.  
  682. %
  683. % left top "BeginPage"
  684. %
  685. /BeginPage{
  686.  tmatrix setmatrix translate 
  687.  /pmatrix pmatrix currentmatrix def
  688. }bdef
  689.  
  690. %
  691. % "EndPage"
  692. %
  693. /EndPage{
  694.  tmatrix setmatrix
  695. }bdef
  696.  
  697. /PPDSetup{countdictstack mark}bdef
  698. /PPDCleanup{stopped cleartomark countdictstack exch sub dup 0 gt{{end}repeat}{pop}ifelse}bdef
  699.  
  700. %
  701. % - "BO" matrix
  702. %
  703. /BO{
  704.  matrix currentmatrix
  705. }bdef
  706.  
  707. %
  708. % aboutx abouty slant twist "r" -
  709. %
  710. /r{
  711.  /twist xdef
  712.  /slant xdef
  713.  
  714.  sclm 0 twist cos put sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat
  715. }bdef
  716.  
  717. %
  718. % aboutx abouty slant twist "R" -
  719. %
  720. /r'{
  721.  /twist xdef
  722.  /slant xdef
  723.  /deltay xdef
  724.  /deltax xdef
  725.  
  726.  deltax deltay translate
  727.  sclm 0 twist cos put sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat
  728.  deltax neg deltay neg translate
  729. }bdef
  730.  
  731. %
  732. % hscale vscale "s" -
  733. %
  734. /s{scale}bdef
  735.  
  736. %
  737. % xoffset1 yoffset1 hscale vscale xoffset2 yoffset2 "S" -
  738. %
  739. /s'{translate scale neg exch neg exch translate}bdef
  740.  
  741. %
  742. % xoffset yoffset "t" -
  743. %
  744. /t{translate}bdef
  745.  
  746. %
  747. % matrix "EO" -
  748. %
  749. /EO {setmatrix}bdef
  750.  
  751. %
  752. % - BEGINCLIP -
  753. %
  754. /BeginClip {gsave clip}bdef
  755.  
  756. %
  757. % - ENDCLIP -
  758. %
  759. /EndClip {grestore}bdef
  760.  
  761. %
  762. % xscale yscale xoffset yoffset pixelw pixelh bitsperpixel BEGINBITMAP -
  763. %
  764. /BeginBitmap {
  765.  save 8 1 roll /bpp xdef /h xdef /w xdef
  766.  scl translate scale /picstr 8 bpp idiv dup w add 1 sub exch idiv string def
  767.  w h bpp [w 0 0 h neg 0 h] {currentfile picstr readhexstring pop}bind image
  768. }bdef
  769.  
  770. %
  771. % xscale yscale xoffset yoffset pixelw pixelh bitsperpixel BEGINRGBBITMAP -
  772. %
  773. /BeginRGBBitmap {
  774.  save 8 1 roll /bpp xdef /h xdef /w xdef
  775.  scl translate scale /picstr 8 bpp idiv dup w 3 mul add 1 sub exch idiv string def
  776.  w h bpp [w 0 0 h neg 0 h] {currentfile picstr readhexstring pop}bind false 3 colorimage
  777. }bdef
  778.  
  779. %
  780. % - ENDBITMAP -
  781. %
  782. /EndBitmap {restore}bdef
  783.  
  784. %
  785. % xscalex yscale xoffset yoffset BEGINEPS -
  786. %
  787. /BeginEPS {
  788.  scl translate scale translate
  789.  /PGSEPSSave save def
  790.  /dict_count countdictstack def /op_count count 1 sub def
  791.  userdict begin
  792.  /showpage {}bdef
  793.  newpath 0 setgray 1 setlinewidth [] 0 setdash 0 setlinecap 0 setlinejoin 10 setmiterlimit
  794.  /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint}if }if
  795. }bdef
  796.  
  797. %
  798. % - ENDEPS -
  799. %
  800. /EndEPS {count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat PGSEPSSave restore}bdef
  801.  
  802. %
  803. % angle cx cy cropmark -
  804. %
  805. /cropmark {
  806.   gsave translate 1 tilescalex div 1 tilescaley div scale rotate
  807.   .3 setlinewidth newpath
  808.   bh 5 add 0 moveto 20 0 rlineto
  809.   0 bv 5 add moveto 0 20 rlineto
  810.   stroke grestore
  811. }bdef
  812.  
  813. %
  814. % dx dy cx cy regmark -
  815. %
  816. /regmark {
  817.   gsave translate 1 tilescalex div 1 tilescaley div scale translate
  818.   .3 setlinewidth newpath
  819.   10 0 moveto 0 0 10 0 360 arc
  820.   1 SG fill
  821.   8 0 moveto 0 0 8 0 360 arc
  822.   -10 0 moveto 10 0 lineto 0 -10 moveto 0 10 lineto
  823.   0 SG stroke
  824.   4 0 moveto 0 0 4 0 360 arc
  825.   fill
  826.   -4 0 moveto 4 0 lineto 0 -4 moveto 0 4 lineto
  827.   1 SG stroke
  828.   grestore
  829. }bdef
  830.  
  831. %
  832. % dx dy cx cy slurgauge -
  833. %
  834. /slurgauge {
  835.   gsave translate 1 tilescalex div 1 tilescaley div scale translate
  836.   .3 setlinewidth newpath
  837.   0 0 10 0 360 arc
  838.   1 SG fill
  839.   0 0 10 0 360 arc
  840.   0 SG stroke
  841.   36 { 1 0 moveto 0 0 10 -2.5 2.5 arc fill 10 rotate}repeat
  842.   grestore
  843. }bdef
  844.  
  845. /boxit {newpath moveto 14 0 rlineto 0 -14 rlineto -14 0 rlineto closepath}def
  846.  
  847. %
  848. % angle dx dy cx cy colorstrip -
  849. %
  850. /colorstrip {
  851.   gsave translate 1 tilescalex div 1 tilescaley div scale translate rotate
  852.  
  853.   /PGSCourier/Courier RE /PGSCourier findfont 6 scalefont setfont
  854.  
  855.   sepmode 1 eq {
  856.     0 8 translate
  857.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill}for
  858.    }if
  859.  
  860.   sepmode 2 eq sepmode 3 eq or {
  861.     gsave 320 15 translate
  862.     0 0 boxit .5 .41 .41 0 scmyk fill
  863.     15 0 boxit 0 0 0 .5 scmyk fill
  864.     30 0 boxit 1 1 0 0 scmyk fill
  865.     45 0 boxit 1 0 1 0 scmyk fill
  866.     60 0 boxit 0 1 1 0 scmyk fill
  867.     75 0 boxit 1 1 1 0 scmyk fill
  868.     1 SG
  869.     33 -6 moveto (CM) show
  870.     48 -6 moveto (CY) show
  871.     63 -6 moveto (MY) show
  872.     77 -6 moveto (CMY) show
  873.     grestore
  874.  
  875.  
  876.     0 0 0 1 scmyk -6 9 moveto (K) show
  877.     0 1 9 {dup 15 mul 15 boxit 10 div 0 0 0 4 -1 roll scmyk fill}for
  878.  
  879.     1 0 0 0 scmyk -6 -6 moveto (C) show
  880.     0 1 9 {dup 15 mul 0 boxit 10 div 0 0 0 scmyk fill}for
  881.  
  882.     0 1 0 0 scmyk 154 9 moveto (M) show
  883.     0 1 9 {dup 15 mul 160 add 15 boxit 10 div 0 exch 0 0 scmyk fill}for
  884.  
  885.     0 0 1 0 scmyk 154 -6 moveto (Y) show
  886.     0 1 9 {dup 15 mul 160 add 0 boxit 10 div 0 0 3 -1 roll 0 scmyk fill}for
  887.  
  888.    }if
  889.  
  890.   sepmode 4 eq {
  891.     320 0 translate
  892.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill}for
  893.    }if
  894.  
  895.   grestore
  896. }def
  897.  
  898. %
  899. % title1 title2 tilew tileh PRINTERSMARKS -
  900. %
  901. /PrintersMarks {
  902.  /tileh xdef
  903.  /tilew xdef
  904.  /title2 xdef
  905.  /title1 xdef
  906.  
  907.  gsave 0 SG [] 0 setdash 0 setlinejoin 0 setlinecap
  908.  
  909.  180 0 0 cropmark
  910.  270 tilew 0 cropmark
  911.  0 tilew tileh cropmark
  912.  90 0 tileh cropmark
  913.  
  914.  0 15 bv add tilew 2 div tileh regmark
  915.  0 -15 bv sub tilew 2 div 0 regmark
  916.  
  917.  -15 bh sub -15 bv sub 0 0 slurgauge
  918.  15 bh add 15 bv add tilew tileh slurgauge
  919.  
  920.   gsave 1 tilescalex div 1 tilescaley div scale -15 bh sub 8 translate 90 rotate
  921.   /PGSCourier/Courier RE /PGSCourier findfont 8 scalefont setfont
  922.   0 0 moveto title1 show
  923.   0 -8 moveto title2 show (  ) show
  924.   currentscreen pop exch 20 string cvs show ( lpi  ) show
  925.   20 string cvs show (\260  ) show
  926.   tilescalex 100 mul 20 string cvs show (%) show
  927.   tilescaley tilescalex ne {(,) show tilescaley 100 mul 20 string cvs show (%) show}if
  928.   grestore
  929.  
  930.  90 bh 15 add 15 tilew 0 colorstrip
  931.  grestore
  932. }bdef
  933.  
  934. end
  935. %%EndProlog
  936.